package com.zhangshuo.patternDesign.singleton;


/**
 * Created by shuo.zhang on 2017-10-17.
 */
public class Singleton1 {

    private Singleton1(){}

    private static Singleton1 instance ;

    public static Singleton1 getInstance(){


        if(instance == null){

            synchronized (Singleton1.class){
                if(instance == null){

                    instance = new Singleton1();
                }
            }

        }

        return instance;


    }
}
